package Person.File;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileOutputStreamDemo02 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("d:\\fos.txt");
        //new File(name)
       // FileOutputStream f = new FileOutputStream(new File("c:\\IDEA\\fos.txt"));
   // File f = new File("c:\\IDEA\\fos.txt");
    //FileOutputStream fos2 = new FileOutputStream(f);
   //void.write(int b) 将指定的字节写入此文件输出流
    //fos.write(97);
   // fos.write(98);
    //fos.write(99);
    //fos.write(100);
   // fos.write(101);
//void write(byte[] b)  将b。length 字节从指定的字节数组写入文件输出流
//byte[] bys = {97,98,99,100,101};
        byte[] bys = "abcde".getBytes();
       // fos.write(bys);
//void write(byte[] b,int off,int len)将len字节从指定的字节数组开始，从偏移量off开始写入文件字节流
        //fos.write(bys,0,bys.length);
fos.write(bys,1,3);
    }
}
